package com.lib.view.banner.holder;

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.lib.base.R;
import com.lib.bean.BannerNormal;
import com.lib.utls.glide.GlideConfig;
import com.ms.banner.holder.BannerViewHolder;

public class CusViewHolder3 implements BannerViewHolder<BannerNormal> {

    private ImageView image1;
    private TextView tvTitle, tvSeeNum, tvDate;

    @Override
    public View createView(Context context) {
        View view = LayoutInflater.from(context).inflate(R.layout.banner_new, null);
        image1 = view.findViewById(R.id.banner);

        tvTitle = view.findViewById(R.id.tv_banner_title);
        tvSeeNum = view.findViewById(R.id.tv_banner_seeNum);
        tvDate = view.findViewById(R.id.tv_banner_date);

        return view;
    }

    @Override
    public void onBind(Context context, int position, BannerNormal data) {

        Glide.with(context)
                .load(data.getCustomData().getUrl())
                .apply(GlideConfig.getRoundOptions(20))
                .into(image1);

        tvTitle.setText(data.getDescripeBean().getTitle());
        tvSeeNum.setText(data.getDescripeBean().getSeeNum());
        tvDate.setText(data.getDescripeBean().getDate());


    }
}
